package com.sa.ibiz.demo.demo.domain;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import org.springframework.cglib.beans.BeanMap;
import org.springframework.cglib.beans.BeanGenerator;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.FieldFill;
import java.util.Map;
import java.util.HashMap;
import org.springframework.util.StringUtils;
import com.sa.ibiz.demo.ibizutil.security.AuthenticationUser;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import org.springframework.util.DigestUtils;
import org.springframework.util.StringUtils;
import java.util.UUID;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import org.springframework.cglib.beans.BeanCopier;
import com.sa.ibiz.demo.ibizutil.annotation.Dict;
import com.sa.ibiz.demo.ibizutil.domain.EntityBase;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import java.math.BigInteger;
import com.sa.ibiz.demo.ibizutil.enums.FillMode;
import com.sa.ibiz.demo.ibizutil.enums.PredefinedType;
import com.sa.ibiz.demo.ibizutil.annotation.PreField;
import com.alibaba.fastjson.annotation.JSONField;

import com.sa.ibiz.demo.demo.domain.DataEntity;

/**
 * 实体[QueryModel] 数据对象
 */
@TableName(value = "T_SRFQUERYMODEL",resultMap = "QueryModelResultMap")
@JsonIgnoreProperties(ignoreUnknown = true)
@Data
public class QueryModel extends EntityBase implements Serializable{

    @JSONField(serialize = false)
    @JsonIgnore
    @TableField(exist = false)//关系主表数据
    private DataEntity de;
    @PreField(fill= FillMode.INSERT,preType = PredefinedType.CREATEDATE)
    private Timestamp createdate;
    @PreField(fill= FillMode.INSERT,preType = PredefinedType.CREATEMAN)
    @Dict(dictName = "WorkflowMob_SysOperatorCodeList")
    private String createman;
    private String deid;
    @TableField(exist = false)//逻辑属性
    private String dename;
    private String groupmodel;
    @Dict(dictName = "WorkflowMob_YesNoCodeList")
    private Integer israwmode;
    private String memo;
    private Integer qmversion;
    private String querycond;
    private String queryfield;
    private String querymodel;
    @TableId(value= "querymodelid",type=IdType.UUID)//指定主键生成策略
    private String querymodelid;
    private String querymodelname;
    private String queryobject;
    private String queryparam;
    private String querysql;
    private String selectmode;
    private String selectorder;
    @Dict(dictName = "WorkflowMob_YesNoCodeList")
    private Integer srfsyspub;
    @Dict(dictName = "WorkflowMob_YesNoCodeList")
    private Integer srfuserpub;
    @PreField(fill= FillMode.INSERT_UPDATE,preType = PredefinedType.UPDATEDATE)
    private Timestamp updatedate;
    @PreField(fill= FillMode.INSERT_UPDATE,preType = PredefinedType.UPDATEMAN)
    @Dict(dictName = "WorkflowMob_SysOperatorCodeList")
    private String updateman;
    /**
     *  设置属性值[建立时间]
     *  @param createdate
     */
    public void setCreatedate(Timestamp createdate){
        this.createdate = createdate;
        this.set("createdatedirtyflag",true);
    }
    /**
     *  获取属性值[建立时间]
     */
    public Timestamp getCreatedate(){
        return this.createdate;
    }
    /**
     *  重置属性值[建立时间]
     */
    public void resetCreatedate(){
        this.set("createdatedirtyflag",false);
        this.createdate = null;
    }
    /**
     *  设置属性值[建立人]
     *  @param createman
     */
    public void setCreateman(String createman){
        if(StringUtils.isEmpty(createman))
            createman=null;
        this.createman = createman;
        this.set("createmandirtyflag",true);
    }
    /**
     *  获取属性值[建立人]
     */
    public String getCreateman(){
        return this.createman;
    }
    /**
     *  重置属性值[建立人]
     */
    public void resetCreateman(){
        this.set("createmandirtyflag",false);
        this.createman = null;
    }
    /**
     *  设置属性值[查询模型_相关实体]
     *  @param deid
     */
    public void setDeid(String deid){
        if(StringUtils.isEmpty(deid))
            deid=null;
        this.deid = deid;
        this.set("deiddirtyflag",true);
    }
    /**
     *  获取属性值[查询模型_相关实体]
     */
    public String getDeid(){
        return this.deid;
    }
    /**
     *  重置属性值[查询模型_相关实体]
     */
    public void resetDeid(){
        this.set("deiddirtyflag",false);
        this.deid = null;
    }
    /**
     *  设置属性值[数据对象]
     *  @param dename
     */
    public void setDename(String dename){
        if(StringUtils.isEmpty(dename))
            dename=null;
        this.dename = dename;
        this.set("denamedirtyflag",true);
    }
    /**
     *  获取属性值[数据对象]
     */
    public String getDename(){
        return this.dename;
    }
    /**
     *  重置属性值[数据对象]
     */
    public void resetDename(){
        this.set("denamedirtyflag",false);
        this.dename = null;
    }
    /**
     *  设置属性值[分组模型]
     *  @param groupmodel
     */
    public void setGroupmodel(String groupmodel){
        if(StringUtils.isEmpty(groupmodel))
            groupmodel=null;
        this.groupmodel = groupmodel;
        this.set("groupmodeldirtyflag",true);
    }
    /**
     *  获取属性值[分组模型]
     */
    public String getGroupmodel(){
        return this.groupmodel;
    }
    /**
     *  重置属性值[分组模型]
     */
    public void resetGroupmodel(){
        this.set("groupmodeldirtyflag",false);
        this.groupmodel = null;
    }
    /**
     *  设置属性值[直接代码]
     *  @param israwmode
     */
    public void setIsrawmode(Integer israwmode){
        this.israwmode = israwmode;
        this.set("israwmodedirtyflag",true);
    }
    /**
     *  获取属性值[直接代码]
     */
    public Integer getIsrawmode(){
        return this.israwmode;
    }
    /**
     *  重置属性值[直接代码]
     */
    public void resetIsrawmode(){
        this.set("israwmodedirtyflag",false);
        this.israwmode = null;
    }
    /**
     *  设置属性值[备注]
     *  @param memo
     */
    public void setMemo(String memo){
        if(StringUtils.isEmpty(memo))
            memo=null;
        this.memo = memo;
        this.set("memodirtyflag",true);
    }
    /**
     *  获取属性值[备注]
     */
    public String getMemo(){
        return this.memo;
    }
    /**
     *  重置属性值[备注]
     */
    public void resetMemo(){
        this.set("memodirtyflag",false);
        this.memo = null;
    }
    /**
     *  设置属性值[版本]
     *  @param qmversion
     */
    public void setQmversion(Integer qmversion){
        this.qmversion = qmversion;
        this.set("qmversiondirtyflag",true);
    }
    /**
     *  获取属性值[版本]
     */
    public Integer getQmversion(){
        return this.qmversion;
    }
    /**
     *  重置属性值[版本]
     */
    public void resetQmversion(){
        this.set("qmversiondirtyflag",false);
        this.qmversion = null;
    }
    /**
     *  设置属性值[查询条件]
     *  @param querycond
     */
    public void setQuerycond(String querycond){
        if(StringUtils.isEmpty(querycond))
            querycond=null;
        this.querycond = querycond;
        this.set("queryconddirtyflag",true);
    }
    /**
     *  获取属性值[查询条件]
     */
    public String getQuerycond(){
        return this.querycond;
    }
    /**
     *  重置属性值[查询条件]
     */
    public void resetQuerycond(){
        this.set("queryconddirtyflag",false);
        this.querycond = null;
    }
    /**
     *  设置属性值[查询字段]
     *  @param queryfield
     */
    public void setQueryfield(String queryfield){
        if(StringUtils.isEmpty(queryfield))
            queryfield=null;
        this.queryfield = queryfield;
        this.set("queryfielddirtyflag",true);
    }
    /**
     *  获取属性值[查询字段]
     */
    public String getQueryfield(){
        return this.queryfield;
    }
    /**
     *  重置属性值[查询字段]
     */
    public void resetQueryfield(){
        this.set("queryfielddirtyflag",false);
        this.queryfield = null;
    }
    /**
     *  设置属性值[查询模型]
     *  @param querymodel
     */
    public void setQuerymodel(String querymodel){
        if(StringUtils.isEmpty(querymodel))
            querymodel=null;
        this.querymodel = querymodel;
        this.set("querymodeldirtyflag",true);
    }
    /**
     *  获取属性值[查询模型]
     */
    public String getQuerymodel(){
        return this.querymodel;
    }
    /**
     *  重置属性值[查询模型]
     */
    public void resetQuerymodel(){
        this.set("querymodeldirtyflag",false);
        this.querymodel = null;
    }
    /**
     *  设置属性值[实体查询模型标识]
     *  @param querymodelid
     */
    public void setQuerymodelid(String querymodelid){
        if(StringUtils.isEmpty(querymodelid))
            querymodelid=null;
        this.querymodelid = querymodelid;
        this.set("querymodeliddirtyflag",true);
    }
    /**
     *  获取属性值[实体查询模型标识]
     */
    public String getQuerymodelid(){
        return this.querymodelid;
    }
    /**
     *  重置属性值[实体查询模型标识]
     */
    public void resetQuerymodelid(){
        this.set("querymodeliddirtyflag",false);
        this.querymodelid = null;
    }
    /**
     *  设置属性值[实体查询模型名称]
     *  @param querymodelname
     */
    public void setQuerymodelname(String querymodelname){
        if(StringUtils.isEmpty(querymodelname))
            querymodelname=null;
        this.querymodelname = querymodelname;
        this.set("querymodelnamedirtyflag",true);
    }
    /**
     *  获取属性值[实体查询模型名称]
     */
    public String getQuerymodelname(){
        return this.querymodelname;
    }
    /**
     *  重置属性值[实体查询模型名称]
     */
    public void resetQuerymodelname(){
        this.set("querymodelnamedirtyflag",false);
        this.querymodelname = null;
    }
    /**
     *  设置属性值[查询对象]
     *  @param queryobject
     */
    public void setQueryobject(String queryobject){
        if(StringUtils.isEmpty(queryobject))
            queryobject=null;
        this.queryobject = queryobject;
        this.set("queryobjectdirtyflag",true);
    }
    /**
     *  获取属性值[查询对象]
     */
    public String getQueryobject(){
        return this.queryobject;
    }
    /**
     *  重置属性值[查询对象]
     */
    public void resetQueryobject(){
        this.set("queryobjectdirtyflag",false);
        this.queryobject = null;
    }
    /**
     *  设置属性值[查询参数]
     *  @param queryparam
     */
    public void setQueryparam(String queryparam){
        if(StringUtils.isEmpty(queryparam))
            queryparam=null;
        this.queryparam = queryparam;
        this.set("queryparamdirtyflag",true);
    }
    /**
     *  获取属性值[查询参数]
     */
    public String getQueryparam(){
        return this.queryparam;
    }
    /**
     *  重置属性值[查询参数]
     */
    public void resetQueryparam(){
        this.set("queryparamdirtyflag",false);
        this.queryparam = null;
    }
    /**
     *  设置属性值[查询SQL]
     *  @param querysql
     */
    public void setQuerysql(String querysql){
        if(StringUtils.isEmpty(querysql))
            querysql=null;
        this.querysql = querysql;
        this.set("querysqldirtyflag",true);
    }
    /**
     *  获取属性值[查询SQL]
     */
    public String getQuerysql(){
        return this.querysql;
    }
    /**
     *  重置属性值[查询SQL]
     */
    public void resetQuerysql(){
        this.set("querysqldirtyflag",false);
        this.querysql = null;
    }
    /**
     *  设置属性值[查询模式]
     *  @param selectmode
     */
    public void setSelectmode(String selectmode){
        if(StringUtils.isEmpty(selectmode))
            selectmode=null;
        this.selectmode = selectmode;
        this.set("selectmodedirtyflag",true);
    }
    /**
     *  获取属性值[查询模式]
     */
    public String getSelectmode(){
        return this.selectmode;
    }
    /**
     *  重置属性值[查询模式]
     */
    public void resetSelectmode(){
        this.set("selectmodedirtyflag",false);
        this.selectmode = null;
    }
    /**
     *  设置属性值[查询排序信息]
     *  @param selectorder
     */
    public void setSelectorder(String selectorder){
        if(StringUtils.isEmpty(selectorder))
            selectorder=null;
        this.selectorder = selectorder;
        this.set("selectorderdirtyflag",true);
    }
    /**
     *  获取属性值[查询排序信息]
     */
    public String getSelectorder(){
        return this.selectorder;
    }
    /**
     *  重置属性值[查询排序信息]
     */
    public void resetSelectorder(){
        this.set("selectorderdirtyflag",false);
        this.selectorder = null;
    }
    /**
     *  设置属性值[框架发布]
     *  @param srfsyspub
     */
    public void setSrfsyspub(Integer srfsyspub){
        this.srfsyspub = srfsyspub;
        this.set("srfsyspubdirtyflag",true);
    }
    /**
     *  获取属性值[框架发布]
     */
    public Integer getSrfsyspub(){
        return this.srfsyspub;
    }
    /**
     *  重置属性值[框架发布]
     */
    public void resetSrfsyspub(){
        this.set("srfsyspubdirtyflag",false);
        this.srfsyspub = null;
    }
    /**
     *  设置属性值[应用发布]
     *  @param srfuserpub
     */
    public void setSrfuserpub(Integer srfuserpub){
        this.srfuserpub = srfuserpub;
        this.set("srfuserpubdirtyflag",true);
    }
    /**
     *  获取属性值[应用发布]
     */
    public Integer getSrfuserpub(){
        return this.srfuserpub;
    }
    /**
     *  重置属性值[应用发布]
     */
    public void resetSrfuserpub(){
        this.set("srfuserpubdirtyflag",false);
        this.srfuserpub = null;
    }
    /**
     *  设置属性值[更新时间]
     *  @param updatedate
     */
    public void setUpdatedate(Timestamp updatedate){
        this.updatedate = updatedate;
        this.set("updatedatedirtyflag",true);
    }
    /**
     *  获取属性值[更新时间]
     */
    public Timestamp getUpdatedate(){
        return this.updatedate;
    }
    /**
     *  重置属性值[更新时间]
     */
    public void resetUpdatedate(){
        this.set("updatedatedirtyflag",false);
        this.updatedate = null;
    }
    /**
     *  设置属性值[更新人]
     *  @param updateman
     */
    public void setUpdateman(String updateman){
        if(StringUtils.isEmpty(updateman))
            updateman=null;
        this.updateman = updateman;
        this.set("updatemandirtyflag",true);
    }
    /**
     *  获取属性值[更新人]
     */
    public String getUpdateman(){
        return this.updateman;
    }
    /**
     *  重置属性值[更新人]
     */
    public void resetUpdateman(){
        this.set("updatemandirtyflag",false);
        this.updateman = null;
    }
     /**
     *  获取主实体关联数据[DataEntity]
     */
    public DataEntity getDe() {
        return de;
    }
    /**
     *  设置主实体关联数据[DataEntity]
     */
    public void setDe(DataEntity de) {
        this.de = de;
    }

    /**
     * 重置当前数据对象属性值
     */
    public  void reset(){
        resetCreatedate();
        resetCreateman();
        resetDeid();
        resetDename();
        resetGroupmodel();
        resetIsrawmode();
        resetMemo();
        resetQmversion();
        resetQuerycond();
        resetQueryfield();
        resetQuerymodel();
        resetQuerymodelid();
        resetQuerymodelname();
        resetQueryobject();
        resetQueryparam();
        resetQuerysql();
        resetSelectmode();
        resetSelectorder();
        resetSrfsyspub();
        resetSrfuserpub();
        resetUpdatedate();
        resetUpdateman();
    }
     /**
     * 获取数据主键（普通主键与联合主键）
     * @return
     */
    @JsonIgnore
    public Serializable getDefaultPrimaryKey()
    {
	    //随机生成主键
         return  IdWorker.get32UUID();

    }
     /**
     * 复制当前对象数据到目标对象(粘贴重置)
     *
     * @throws Exception
     */
    public QueryModel copyTo(QueryModel targetEntity)
	{
		BeanCopier copier=BeanCopier.create(QueryModel.class, QueryModel.class, false);
		copier.copy(this, targetEntity, null);
        targetEntity.resetQuerymodelid();
		return targetEntity;
	}
}